package com.iqik.sc;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;

@SpringBootApplication
@EnableDiscoveryClient
@EnableFeignClients // 开启Feign客户端功能
public class AutoDeliverApplication8092 {


    public static void main(String[] args) {
        SpringApplication.run(AutoDeliverApplication8092.class);
    }

    /**
     * 在被监控的微服务中注册一个servlet，通过此servlet来获取该服务的Hystrix数据
     * 被监控的微服务需要引入
     * @return
     */
//    @Bean
//    public ServletRegistrationBean getServletRegistrationBean() {
//        HystrixMetricsStreamServlet streamServlet = new HystrixMetricsStreamServlet();
//        ServletRegistrationBean servletRegistrationBean = new ServletRegistrationBean(streamServlet);
//        servletRegistrationBean.setLoadOnStartup(1);
//        servletRegistrationBean.addUrlMappings("/actuator/hystrix.stream");
//        servletRegistrationBean.setName("HystrixMetricsStreamServlet");
//        return servletRegistrationBean;
//    }
}
